package com.zx.idc.backend.gui.sys;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zx.idc.backend.gui.common.BasicBaseApi;
import com.zx.idc.backend.gui.common.Result;
import com.zx.idc.ds.sys.entity.SysConfProvince;
import com.zx.idc.ds.sys.service.ISysConfProvinceService;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 省份表 前端控制器
 * </p>
 *
 * @author rxliuli
 * @since 2019-03-13
 */
@RestController
@RequestMapping("/api/sysConfProvince")
public class SysConfProvinceController extends BasicBaseApi<ISysConfProvinceService, SysConfProvince> {

    @GetMapping("/select-list")
    public Result<List<SysConfProvince>> list() {
        return success(service.selectList(
            new EntityWrapper<SysConfProvince>().setSqlSelect("id", "name")
        ));
    }

    @GetMapping("/get/{id}")
    public Result<SysConfProvince> get(@PathVariable String id) {
        return success(service.selectById(id));
    }

    @PostMapping("/delete")
    public Result<Boolean> get(@RequestBody List<String> ids) {
        return success(service.deleteBatchIds(ids));
    }

}

